home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zoom 2
/
Zoom - Release 2 (1996)(Active Software)[!].iso
/
texts
/
dosman121
/
man
/
eval
< prev
next >
Wrap
Text File
|
1995-05-05
|
3KB
|
83 lines
Eval(V1.3, 2.x, and 3.x in C:)
NAME
Eval - evaluate arithmetic and logical expressions.
SYNOPSIS
Eval Value1/a Op Value2 TO/k L=LFORMAT/k
DESCRIPTION
Eval computes the results of simple arithmetic and
logical expressions as applied to two arguments, and
displays the result on its standard output. Numeric
arguments may be input as:
Decimal
This is the default, no extra qualifiers needed.
Hexadecimal
Enter hexadecimal numbers as 0x<number> or
#x<number>, for example: 0x1A or #x1A.
Octal
Enter octal numbers as 0<number> or #<number>, for
example: 0777 or #777.
Binary
Binary numbers (in ARP eval only) may be entered with
#B, for example: B1111
Character
Characters are supported only by the Commodore Eval.
The operations supported are given below:
addition + not ~
subtraction - left shift <<
multiplication * right shift >>
division / negation -
mod mod exclusive or xor
and & bitwise equivalence eqv
or |
Any fractional amounts that result from this process
are discarded.
OPTIONS
TO
You can send the output of Eval to a file which is
indicated in the path with this keyword.
L=LFORMAT
You can control the output format of Eval using this
keyword.
There are four formats you specify: hexadecimal (%X)
Octal (%O), Decimal (%N), or ASCII (%C). The hex and
octal formats require a number after the letter to
indicate how many letters you want to print. For
example, to display a hexadecimal number in a field of 8,
you can do LFORMAT="%08lx". You can also include escape
characters (such as *n for a newline) inside your LFORMAT
string. For this release of Eval, you also need to
always use the 'l' (for long) format character with all
format commands. The default is set to Decimal.
You can also include any text you desire in the
format string by using quotes. For example:
LFORMAT = "There are %N widgets sold."
EXAMPLE
1. To find the sum of 2 + 2 and print the answer as 2
octal digits followed by a new line character.
EVAL 2 + 2 LFORMAT = "%O2*N"